<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<title>修改商品信息</title>

<!-- Bootstrap -->
<link
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	rel="stylesheet">
<script type="text/javascript">
	function check() {
		var name = document.getElementById("name").value;
		var add = document.getElementById("add").value;
		var tel = document.getElementById("tel").value;
		var concat = document.getElementById("concat").value;

		var namemag = document.getElementById("namemag");
		var addmag = document.getElementById("addmag");
		var telmag = document.getElementById("telmag");
		var concatmag = document.getElementById("concatmag");

		if (name == null || name.length == "") {
			namemag.innerHTML = "不可为空";
			namemag.focus();
			namemag.style.color = "red";
			return false;
		} else {
			namemag.innerHTML = "";
		}

		if (add == null || add.length == "") {
			addmag.innerHTML = "不可为空";
			addmag.focus();
			addmag.style.color = "red";
			return false;
		} else {
			addmag.innerHTML = "";
		}

		if (tel == null || tel.length == "") {
			telmag.innerHTML = "不可为空";
			telmag.focus();
			telmag.style.color = "red";
			return false;
		} else {
			telmag.innerHTML = "";
		}
		if (concat == null || concat.length == "") {
			concatmag.innerHTML = "不可为空";
			concatmag.focus();
			concatmag.style.color = "red";
			return false;
		} else {
			concatmag.innerHTML = "";
		}
		document.getElementById("myform").submit();
	}
</script>
</head>
<body>
	<jsp:include page="../top.jsp"></jsp:include>
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<form role="form" action="../supplier/addsupplier" method="post"
					id="myform">
					<div class="form-group">
						<label>供应商名称</label><span id="namemag"></span><input type="text"
							class="form-control" id="name" name="supplier_name" />
					</div>
					<div class="form-group">
						<label>供应商地址</label><span id="addmag"></span><input type="text"
							class="form-control" id="add" name="supplier_address" />
					</div>
					<div class="form-group">
						<label>供应商联系电话</label><span id="telmag"></span><input type="text"
							class="form-control" id="tel" name="supplier_telephone" />
					</div>
					<div class="form-group">
						<label>供应商联系人</label><span id="concatmag"></span><input
							type="text" class="form-control" id="concat"
							name="supplier_contact" />
					</div>
					<br> <br>
					<button type="button" class="btn btn-default btn-block btn-primary"
						onclick="check()">提交</button>
				</form>
			</div>
		</div>
	</div>
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script
		src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>